﻿@{
    ViewBag.Title = "Ins";
}
@section scripts
{   
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js")" type="text/javascript"></script>  
    <script src="@Url.Content("~/Scripts/common/gridlayout.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common/export.js")" type="text/javascript"></script>
}
<body>
   <form id="form1" runat="server" method="post" style="height: 100%">
    
    @Html.Partial("~/Views/Modular/ReportsToolbar.cshtml")
    
    <div id = "DivHeader">
        <table style="margin-bottom:4px;">
            <tr>
                <td width ="70px" align="right">单据日期：</td>
                <td width ="310px">
                    @Html.Partial("~/Views/Modular/dxDateRange.cshtml") 
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td width ="70px" align="right">订单会员：</td>
                <td width ="200px">    
                     @Html.Partial("~/Views/Modular/LookupMember.cshtml")               
                </td>
                <td width ="70px" align="right">门店名称：</td>
                <td width ="200px">    
                    @Html.Partial("~/Views/Modular/LookupStockInfo.cshtml")                      
                </td>
                <td width ="70px" align="right">单据编号：</td>
                <td width ="150px">
                    <input name="FBillNo" class="mini-textbox" style="width:150px;"/>
                </td>
            </tr>
            <tr>
                <td width ="70px" align="right">商品名称：</td>
                <td width ="200px">
                    @Html.Partial("~/Views/Modular/LookupGoodInfo.cshtml")                    
                </td>
                <td width ="70px" align="right">订单状态：</td>
                <td width ="200px">    
                    <input id="comCheckFlag" name ="FCheckFlag" class="mini-combobox" style="width:200px;" 
                    showNullItem="false" required="true" allowInput="false" align="left" data ="dCheckFlag"/>           
                </td>
                <td width ="70px" align="right">收件人：</td>
                <td width ="150px">
                    <input name="FConsignee" class="mini-textbox" style="width:150px;"/>
                </td>
            </tr>
        </table>
    </div>
    <div class="mini-fit">
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" borderStyle="border:1;"pageSize="15"
            url="../RptInterface/GetSaleMergeDetail"
            allowCellSelect="true" allowCellEdit="true" showSummaryRow="false"  fitColumns="false" sortMode="client">
            <div property="columns">
                <div type="checkcolumn" ></div>  
                <div field="FBillNo" width="120" headerAlign="center">订单编号</div>    
                <div field="FPayName" width="100" headerAlign="center">支付详情</div>
                <div field="FStockName" width="100" headerAlign="center">所属门店</div>
                <div field="FClassName" width="100" headerAlign="center">会员卡类别</div>
                <div field="FCasherName" width="120" headerAlign="center">销售人员</div>
                <div field="FName" width="130" headerAlign="center">产品名称</div>
                <div field="mFQty" name="mFQty" width="70" headerAlign="center"align="right"numberFormat="#,0.00">产品数量</div>
                <div field="mFPrice" name="mFPrice" width="70" headerAlign="center"align="right"numberFormat="#,0.00">产品单价</div>
                <div field="mFAmount" name="mFAmount" width="90" headerAlign="center"align="right"numberFormat="#,0.00">产品金额</div>
                <div field="mFMustAmt" name="mFMustAmt" width="90" headerAlign="center"align="right"numberFormat="#,0.00">买家应付货款</div>
                <div field="mFPostAmt" name="mFPostAmt" width="90" headerAlign="center"align="right"numberFormat="#,0.00">买家应付邮费</div>
                <div field="mFRealAmt" name="mFRealAmt" width="120" headerAlign="center"align="right"numberFormat="#,0.00">买家实际支付金额</div>
                <div field="FCouponAmt" name="FCouponAmt" width="90" headerAlign="center"align="right"numberFormat="#,0.00">优惠券金额</div>
                <div field="FShopChkFlag" width="120" headerAlign="center"align="center">是否门店核销定单</div>
                <div field="FShopChkName" width="120" headerAlign="center">核销门店</div>
                <div field="FOrderState" width="100" headerAlign="center"align="center">订单状态</div>
                <div field="FUserName" width="150" headerAlign="center">会员姓名</div>
                <div field="FUserAge" name="FUserAge" width="70" headerAlign="center"align="center" numberFormat="#">会员年龄</div>
                <div field="FBirthday" width="110px"  dateFormat="yyyy-MM-dd"  headerAlign="center">生日</div> 
                <div field="FAddress" width="180" headerAlign="center">收货地址</div>                
                <div field="FShipName" width="100" headerAlign="center">运送方式</div>
                <div field="FPhone" width="120" headerAlign="center">联系电话</div>                
                <div field="FDate" width="130px"  dateFormat="yyyy-MM-dd HH:mm:ss"  headerAlign="center">订单付款时间 </div> 物流单号 
                <div field="express_no" width="130px" headerAlign="center">物流单号 </div>  
                <div field="FRemark" width="120" headerAlign="center">备注</div>
            </div>
        </div>  
    </div>
    
    <script type="text/javascript">

        var dCheckFlag = [{ "id": "0", "text": "全部" },
                         { "id": "1", "text": "未审核" },
                         { "id": "2", "text": "已审核" }]

        mini.parse();
        var form = new mini.Form("form1");
        var grid = mini.get("datagrid1");
        var uID = parent.window.getSystemAppID();
        var hdatatype = getQueryString("datatype");
        var sumFields = "";

        function FormShown() {
            var nowDate = new Date();
            mini.getbyName("FDate1").setValue(nowDate);
            mini.getbyName("FDate2").setValue(nowDate);
            mini.getbyName("FCheckFlag").select(0);
            LoadData();
        }

        function clearloca() {
            mini.getbyName("FStockID").setValue("");
            mini.getbyName("FStockID").setText("");
            mini.getbyName("FStockName").setValue("");
            mini.getbyName("FMemberNumber").setValue("");
            mini.getbyName("FMemberNumber").setText("");
            mini.getbyName("FMemberName").setValue("");
            mini.getbyName("FBillNo").setValue("");
            mini.getbyName("FGoodItemID").setValue("");
            mini.getbyName("FGoodItemID").setText("");
            mini.getbyName("FGoodName").setValue("");
            mini.getbyName("FConsignee").setValue("");
        }

        function LoadData() {
            var cDate1 = mini.getbyName("FDate1").getFormValue();
            var cDate2 = mini.getbyName("FDate2").getFormValue();
            var mCheckFlag = mini.getbyName("FCheckFlag").getValue();
            var mBillNo = mini.getbyName("FBillNo").getValue();
            var mStockID = mini.getbyName("FStockID").getValue();
            var mMemberID = mini.getbyName("FMemberNumber").getValue();
            var mConsignee = mini.getbyName("FConsignee").getValue();
            var mGoodsID = mini.getbyName("FGoodItemID").getValue();

            var json = "[{";
            json = json + '"mListType":' + '"' + hdatatype + '",';//列表类型
            json = json + '"mSystemAppID":' + '"' + uID + '",';
            json = json + '"mDate1":' + '"' + cDate1 + '",';
            json = json + '"mDate2":' + '"' + cDate2 + '",';
            json = json + '"mCheckFlag":' + '"' + mCheckFlag + '",';            
            json = json + '"mStockID":' + '"' + mStockID + '",';
            json = json + '"mMemberID":' + '"' + mMemberID + '",';
            json = json + '"mConsignee":' + '"' + mConsignee + '",';
            json = json + '"mGoodsID":' + '"' + mGoodsID + '",';
            json = json + '"mBillNo":' + '"' + mBillNo + '"';
            json = json + "}]";

            grid.load({ mydata: json });

            mExportDataUrl = grid.url;
            mExportDataJson = json;//导出
        }
        function printdata() {
            var url = "../Report/PrintReport";
            mini.open({
                url: url,
                title: "打印", width: 1000, height: 700,
                onload: function () {
                    var iframe = this.getIFrameEl();
                    var NoneDisplayCol = [0];
                    iframe.contentWindow.InitalPrint(grid, NoneDisplayCol, parent.window.getSystemCompany() + "电商订单明细表");
                }
            });
        }

    </script>

    </form>
</body>